home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
biblio
/
bibtex
/
utils
/
bibtools
/
bibify
< prev
next >
Wrap
Text File
|
1992-09-03
|
644b
|
38 lines
#!/bin/csh -f
if ($1 !~ *.aux) then
set input=$1.aux
set bbl = $1.bbl
else
set input=$1
set bbl=$1:r.bbl
endif
set file=/tmp/bibify$$
onintr clean
cat $input > $file
set style=`sed -n 's/\\bibstyle{\(.*\)}/\1/p' $input`
switch($style)
case "alpha":
case "/u/dfk/lib/abstract":
cat $bbl | sed -n 's/bibitem\[\(.*\)\]{\(.*\)}/bibcite{\2}{\1}/p' >> $file
breaksw
case "plain":
case "unsrt":
case "abbrv":
cat $bbl | sed -n 's/bibitem/bibcite/p'| awk '{print $1"{"NR"}"}' >> $file
breaksw
default:
echo unknown bibliography style, cannot bibify.
goto clean
endsw
mv $file $input
clean:
/bin/rm -f $file.* >& /dev/null